import { Component, OnInit, ViewChild } from '@angular/core';
import { HistoricalAlertComponent } from './historical-alert/historical-alert.component';
import { BullySubjectService } from 'app/shared/service';
import { IrInfoCreateComponent } from '../traffic-alert/ir-info-detail/ir-info-detail.component';
@Component({
    selector: 'itmp-traffic-alert',
    templateUrl: './traffic-alert.component.html',
    styleUrls: ['./traffic-alert.component.css']
})
export class TrafficAlertComponent implements OnInit {
    // @ViewChild(HistoricalAlertComponent) private _alertHistCom: HistoricalAlertComponent;
    @ViewChild(HistoricalAlertComponent) private alertHistCom: HistoricalAlertComponent;
    selectIndex = 0;
    zoneList = [];
    isIRclicked = false;
    constructor(private bully: BullySubjectService) {}
    ngOnInit() {
        this.bully.zoneListBehavior.subscribe(res => {
            this.zoneList = res['selectZoneList'] ? res['selectZoneList'] : [];
        });
    }

    ignoreAlertFunc(e) {
        this.selectIndex = 1;
        // this.alertHistCom.refresh();
    }
    irSelected(e) {
        this.isIRclicked = true;
    }
}
